# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.MigrationCenter.V1.Model.MachineDetails do
  @moduledoc """
  Details of a machine.

  ## Attributes

  *   `architecture` (*type:* `GoogleApi.MigrationCenter.V1.Model.MachineArchitectureDetails.t`, *default:* `nil`) - Architecture details (vendor, CPU architecture).
  *   `coreCount` (*type:* `integer()`, *default:* `nil`) - Number of logical CPU cores in the machine. Must be non-negative.
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Machine creation time.
  *   `disks` (*type:* `GoogleApi.MigrationCenter.V1.Model.MachineDiskDetails.t`, *default:* `nil`) - Disk details.
  *   `guestOs` (*type:* `GoogleApi.MigrationCenter.V1.Model.GuestOsDetails.t`, *default:* `nil`) - Guest OS information.
  *   `machineName` (*type:* `String.t`, *default:* `nil`) - Machine name.
  *   `memoryMb` (*type:* `integer()`, *default:* `nil`) - The amount of memory in the machine. Must be non-negative.
  *   `network` (*type:* `GoogleApi.MigrationCenter.V1.Model.MachineNetworkDetails.t`, *default:* `nil`) - Network details.
  *   `platform` (*type:* `GoogleApi.MigrationCenter.V1.Model.PlatformDetails.t`, *default:* `nil`) - Platform specific information.
  *   `powerState` (*type:* `String.t`, *default:* `nil`) - Power state of the machine.
  *   `uuid` (*type:* `String.t`, *default:* `nil`) - Machine unique identifier.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :architecture =>
            GoogleApi.MigrationCenter.V1.Model.MachineArchitectureDetails.t() | nil,
          :coreCount => integer() | nil,
          :createTime => DateTime.t() | nil,
          :disks => GoogleApi.MigrationCenter.V1.Model.MachineDiskDetails.t() | nil,
          :guestOs => GoogleApi.MigrationCenter.V1.Model.GuestOsDetails.t() | nil,
          :machineName => String.t() | nil,
          :memoryMb => integer() | nil,
          :network => GoogleApi.MigrationCenter.V1.Model.MachineNetworkDetails.t() | nil,
          :platform => GoogleApi.MigrationCenter.V1.Model.PlatformDetails.t() | nil,
          :powerState => String.t() | nil,
          :uuid => String.t() | nil
        }

  field(:architecture, as: GoogleApi.MigrationCenter.V1.Model.MachineArchitectureDetails)
  field(:coreCount)
  field(:createTime, as: DateTime)
  field(:disks, as: GoogleApi.MigrationCenter.V1.Model.MachineDiskDetails)
  field(:guestOs, as: GoogleApi.MigrationCenter.V1.Model.GuestOsDetails)
  field(:machineName)
  field(:memoryMb)
  field(:network, as: GoogleApi.MigrationCenter.V1.Model.MachineNetworkDetails)
  field(:platform, as: GoogleApi.MigrationCenter.V1.Model.PlatformDetails)
  field(:powerState)
  field(:uuid)
end

defimpl Poison.Decoder, for: GoogleApi.MigrationCenter.V1.Model.MachineDetails do
  def decode(value, options) do
    GoogleApi.MigrationCenter.V1.Model.MachineDetails.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.MigrationCenter.V1.Model.MachineDetails do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
